<template>
  <div>
    <h2>当前计数: {{ $store.state.counter }}</h2>
    <hr>
      <button @click="$store.commit('increment')">+1</button>
      <button @click="$store.commit('decrement')">-1</button>
      <button @click="addTen">+10</button>
    <hr>
  </div>
</template>

<script>

  export default {
    methods: {
      addTen() {
        // this.$store.commit('incrementN', 10)
        this.$store.commit('increment_n', 10)
   
    }
  }
  }
</script>

<style scoped>

</style>